package com.mars.admin.modules.user.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;

/**
 * 用户更新请求DTO
 *
 * @author Mars
 */
@Data
@Schema(description = "用户更新请求")
public class UserUpdateRequest {

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户ID不能为空")
    private Long id;

    @Schema(description = "用户名")
    @Size(min = 3, max = 20, message = "用户名长度必须在3-20位之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母、数字和下划线")
    private String username;

    @Schema(description = "昵称")
    @Size(max = 50, message = "昵称长度不能超过50位")
    private String nickname;

    @Schema(description = "真实姓名")
    @Size(max = 50, message = "真实姓名长度不能超过50位")
    private String realName;

    @Schema(description = "手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "邮箱")
    @Email(message = "邮箱格式不正确")
    private String email;

    @Schema(description = "头像URL")
    private String avatar;

    @Schema(description = "性别：0-未知，1-男，2-女")
    private Integer gender;

    @Schema(description = "生日")
    private LocalDate birthday;

    @Schema(description = "个性签名")
    @Size(max = 200, message = "个性签名长度不能超过200位")
    private String signature;

    @Schema(description = "所在地")
    @Size(max = 100, message = "所在地长度不能超过100位")
    private String location;

    @Schema(description = "状态：0-禁用，1-正常，2-审核中")
    private Integer status;

    @Schema(description = "用户等级")
    private Integer level;

    @Schema(description = "经验值")
    private Integer experience;

    @Schema(description = "积分")
    private Integer points;

    @Schema(description = "是否认证：0-否，1-是")
    private Integer isVerified;

    @Schema(description = "认证类型：0-无，1-个人，2-企业，3-官方")
    private Integer verifiedType;
} 